from zvms.util import *

Class = Blueprint('Class', __name__)

@Class.route('/class/<int:id>')
@Class.route('/class')
def get_class(id=None):
    if id is None:
        id = session.get('cls')
    return render_template('class.html', **get(f'/class/{id}')['result'])

@Class.route('/ajax/class')
def get_ajax_class():
    return get('/class/list')['result']